##
## set up plotting field
##
par(bg="white", mfrow = c(2, 1))
title_cex <- 0.9

##
## set up cascade data and bounds
##
data_cascade <- read.csv(file="E:/cascade.log",header=FALSE)
minX_cascade <- data_cascade[1,1]
maxX_cascade <- 500000
#data_cascade[dim(data_cascade)[1],1]
minY_cascade <- data_cascade[1,2]
maxY_cascade <- data_cascade[dim(data_cascade)[1],2]
cascade_title <- "Ozone population evolution, cascade routine is switched on"



##
## set up NOcascade data and bounds
##
data_nocascade <- read.csv(file="E:/nocascade.log",header=FALSE)
minX_nocascade <- data_nocascade[1,1]
maxX_nocascade <- data_nocascade[dim(data_nocascade)[1],1]
minY_nocascade <- data_nocascade[1,2]
maxY_nocascade <- data_nocascade[dim(data_nocascade)[1],2]
nocascade_title <- "Ozone population evolution, cascade routine is switched off"


##
## initialize the top plotting field
##
par(mar = c(5, 5, 3, 3))
plot(NULL, xlim=c(minX_cascade, maxX_cascade), ylim=c(minY_cascade, maxY_cascade), xlab="accretion events", 
   ylab=expression(paste("number of  ",O[3],"  molecules")), col=1)
title(main=list(cascade_title, cex=title_cex))
lines(data_cascade[,1],data_cascade[,2], col="red", lty=1, lwd=1)


##
## initialize the bottom plotting field
##
par(mar = c(5, 5, 3, 3))
plot(NULL, xlim=c(minX_nocascade, maxX_nocascade), ylim=c(minY_nocascade, maxY_nocascade), xlab="accretion events", 
   ylab=expression(paste("number of  ",O[3],"  molecules")), col=1)
title(main=list(nocascade_title, cex=title_cex))
lines(data_nocascade[,1],data_nocascade[,2], col="blue", lty=1, lwd=1)
